Skip to content

declareQueue using wrong queue object #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2019

Conversation

matchbookmac
Copy link
Contributor

Issue

When starting laravel worker using laravel-queue, this error is produced:

[2019-01-24 00:48:33] laravel.ERROR: Argument 1 passed to Enqueue\AmqpLib\AmqpContext::declareQueue() must implement interface Interop\Amqp\AmqpQueue, string given, called in /var/www/html/vendor/enqueue/laravel-queue/src/AmqpQueue.php on line 61 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Argument 1 passed to Enqueue\\AmqpLib\\AmqpContext::declareQueue() must implement interface Interop\\Amqp\\AmqpQueue, string given, called in /var/www/html/vendor/enqueue/laravel-queue/src/AmqpQueue.php on line 61 at /var/www/html/vendor/enqueue/amqp-lib/AmqpContext.php:163)
[stacktrace]
#0 /var/www/html/vendor/enqueue/laravel-queue/src/AmqpQueue.php(61): Enqueue\\AmqpLib\\AmqpContext->declareQueue('wat')
#1 /var/www/html/vendor/enqueue/laravel-queue/src/AmqpQueue.php(47): Enqueue\\LaravelQueue\\AmqpQueue->declareQueue('wat')
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(247): Enqueue\\LaravelQueue\\AmqpQueue->pop('wat')

AmqpContext->declareQueue is expecting the Interop\Amqp\AmqpQueue retrieved on line 57; however, the queue name as a string is passed instead.

Fix

Pass $interopQueue to AmqpContext->declareQueue.

- Issue

When starting laravel worker using laravel-queue, this error is produced:
```
[2019-01-24 00:48:33] laravel.ERROR: Argument 1 passed to Enqueue\AmqpLib\AmqpContext::declareQueue() must implement interface Interop\Amqp\AmqpQueue, string given, called in /var/www/html/vendor/enqueue/laravel-queue/src/AmqpQueue.php on line 61 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Argument 1 passed to Enqueue\\AmqpLib\\AmqpContext::declareQueue() must implement interface Interop\\Amqp\\AmqpQueue, string given, called in /var/www/html/vendor/enqueue/laravel-queue/src/AmqpQueue.php on line 61 at /var/www/html/vendor/enqueue/amqp-lib/AmqpContext.php:163)
[stacktrace]
#0 /var/www/html/vendor/enqueue/laravel-queue/src/AmqpQueue.php(61): Enqueue\\AmqpLib\\AmqpContext->declareQueue('wat')
php-enqueue#1 /var/www/html/vendor/enqueue/laravel-queue/src/AmqpQueue.php(47): Enqueue\\LaravelQueue\\AmqpQueue->declareQueue('wat')
php-enqueue#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(247): Enqueue\\LaravelQueue\\AmqpQueue->pop('wat')
```
`AmqpContext->declareQueue` is expecting the `Interop\Amqp\AmqpQueue` retrieved on line 57; however, the queue name as a string is passed instead.

- Fix

Pass `$interopQueue` to `AmqpContext->declareQueue`.
@makasim makasim merged commit 6179026 into php-enqueue:master Jan 24, 2019
@makasim makasim added the bug label Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants